<template>
 <div class="cate">
   <van-sidebar v-model="activeKey">
      <van-sidebar-item title="全部" />
      <van-sidebar-item :title="item.name" v-for="item in data" :key="item.id" v-show="item.pid==0"/>
    </van-sidebar>
 </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      activeKey: 0,
      data: []
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    async getData() {
      let { data: res } = await this.$http.post(
        "https://api.it120.cc/small4/shop/goods/category/all"
      );
      console.log(res);
      this.data = res.data;
    }
  },
  computed: {},
  watch: {}
};
</script>

<style scoped>
</style>